package meituan;

import java.util.Scanner;

/**
 * @author Hang
 * @date 2022/8/13
 * @project AutumnOffer
 * @description
 **/
public class SweepRobot {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int n = scanner.nextInt();
        int f = scanner.nextInt();
        String str = scanner.next();
        int count = 0;
        boolean[][] vis = new boolean[m][n];
        int x=0,y=0;
        vis[0][0] = true;
        boolean visited = false;
        for(int i=0;i<f;i++){
            if(str.charAt(i)=='S'&&!visited){
                vis[++x][y] = true;
                count++;
                visited = visited(vis);
                continue;
            }
            if(str.charAt(i)=='W'&&!visited){
                vis[--x][y] = true;
                count++;
                visited = visited(vis);
                continue;
            }
            if(str.charAt(i)=='A'&&!visited){
                vis[x][--y] = true;
                count++;
                visited = visited(vis);
                continue;
            }
            if(str.charAt(i)=='D'&&!visited){
                vis[x][++y] = true;
                count++;
                visited = visited(vis);
                continue;
            }
        }
        if(visited){
            System.out.println("Yes");
            System.out.println(count);
        }else{
            System.out.println("No");
            int t = 0;
            for(int i=0;i<m;i++){
                for(int j=0;j<n;j++){
                    if(vis[i][j]==false){
                        t++;
                    }
                }
            }
            System.out.println(t);
        }
    }
    public static boolean visited(boolean[][] vis){
        for(int i=0;i<vis.length;i++){
            for(int j=0;j<vis[0].length;j++){
                if(vis[i][j] != true) return false;
            }
        }
        return true;
    }
}
